<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:xs="http://www.w3.org/2001/XMLSchema"
	xmlns:f="livcos.org/ns/xslt/function"
	exclude-result-prefixes="f xs">
	
	<!-- implementation dependent extension functions (Java, Saxon,...) -->
	
	<xsl:import href="ide_dummy.xsl"/>
	
	<xsl:function name="f:eval" exclude-result-prefixes="#all">
		<xsl:param name="context" as="node()"/>
		<xsl:param name="xPath" as="xs:string"/>
		<xsl:param name="nsContext" as="element()"/>
		<!-- build the context for the eval extension function -->
		<xsl:for-each select="$context">
			<xsl:sequence select="f:eval($xPath, $nsContext)"/>
		</xsl:for-each>
	</xsl:function>
	
	<xsl:function name="f:caller-uri" as="xs:string">
		<xsl:param name="baseUri"/>
		<xsl:param name="uri"/>
		<xsl:value-of select="f:caller-uri(concat($baseUri, if (starts-with($uri, '/')) then '' else '/', $uri))"/>
	</xsl:function>
	
	<xsl:function name="f:isValidUrl" as="xs:boolean">
		<xsl:param name="str"/>
		<xsl:value-of select="boolean(f:uri($str)/path)"/>
	</xsl:function>
	
</xsl:stylesheet>
